#include "get.h"

Get::Get():Process()
{
    name="Get";
}
Get::~Get()
{
}
void Get::Run()
{

    LogManager::getSingleton().Message("Get", "step "+LogManager::getSingleton().toStr(currentStep));
    switch(currentStep){
    case 0:{
        ResourceAllocator::getSingleton().askForResource("MessageToGet",id);
    }
    break;
    case 1:{
        ResourceAllocator::getSingleton().destroyResource(usingResourceList.at(usingResourceList.size()-1));
        ResourceAllocator::getSingleton().askForResource("InputDevice",id);
    }
    break;
    case 2:{
    //input = tai cia turi but stringas ka isvest
    }
    break;
    case 3:{
         ResourceAllocator::getSingleton().freeResource(*usingResourceList.end());
    }
    break;
    case 4:{


        //ResourceAllocator::getSingleton().addResource(new UserInput(id,input)); input is antro zingsnio
         currentStep=-1;
    }
    break;
    default:
      qDebug() << "gg Get";
    }
    currentStep++;
}
